package com.audaque.springboot.foshanupload.web.raspcloud.req.ext;

import com.audaque.springboot.foshanupload.core.model.qo.page.Page;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author chinaben
 * @since 2025-06-24
 */
@Data
@Getter
@Setter
@Schema(name = "UserReq", description = "")
public class RegisterReq extends Page implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{4,20}$", message = "用户名只能包含字母、数字、下划线，长度4-20位")
    @Schema(description = "用户账号")
    private String username;


    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^(?:(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)|(?=.*[A-Z])(?=.*[a-z])(?=.*\\W)|(?=.*[A-Z])(?=.*\\d)(?=.*\\W)|(?=.*[a-z])(?=.*\\d)(?=.*\\W)).{8,20}$", message = "密码必须为8-20位，且包含大写字母、小写字母、数字、特殊字符三种中的至少三种")
    @Schema(description = "密码")
    private String password;

}
